<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    System.out.println("here is regist.jsp ,basePath:" + basePath);
%>
<jsp:include page="../commons/common.jsp" flush="true"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>regist page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <base href="<%=basePath%>">
    <style type="text/css">
        #id {
            border: 1px solid pink;
        }
        #username {
            border: 1px solid pink;
        }
        #password {
            border: 1px solid pink;
        }
        /*.bg{background-image:url(pages/commons/timg.jpg)}*/
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#submit").click(function () {
                var username = $("#username").val();
                if (username === '') {
                    alert("请输入用户名");
                    return;
                }
                var password = $("#password").val();
                if (password === '') {
                    alert("请输入密码");
                    return;
                }
            })
        });
    </script>
</head>

<body class="bg" style="">
<div class="header">
    <div class="am-panel am-panel-primary am-text-primary">
        <h2>User Center</h2>
    </div>
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <h3 class="am-text-warning">register user</h3>
        <form class="am-form am-form-horizontal"
              action="${pageContext.request.contextPath}/LoginServlet?operation=registerUser" method="post">
            <%--<div class="am-form-group">--%>
                <%--<label for="id" class="am-u-sm-2 am-form-label">用户ID</label>--%>
                <%--<div class="am-u-sm-10">--%>
                    <%--<input type="text" id="id" name="id" placeholder="输入用户ID">--%>
                <%--</div>--%>
            <%--</div>--%>
            <div class="am-form-group">
                <label for="username" class="am-u-sm-2 am-form-label">用户名</label>
                <div class="am-u-sm-10">
                    <input type="text" id="username" name="username" placeholder="输入用户名">
                </div>
            </div>
            <div class="am-form-group">
                <label for="password" class="am-u-sm-2 am-form-label">密码</label>
                <div class="am-u-sm-10">
                    <input type="password" id="password" name="password" placeholder="输入密码">
                </div>
            </div>
            <div class="am-form-group">
                <label for="email" class="am-u-sm-2 am-form-label">邮箱</label>
                <div class="am-u-sm-10">
                    <input type="email" id="email" name="email" placeholder="输入邮箱">
                </div>
            </div>
            <div class="am-form-group">
                <label for="tel" class="am-u-sm-2 am-form-label">联系电话</label>
                <div class="am-u-sm-10">
                    <input type="text" id="tel" name="tel" placeholder="输入联系电话">
                </div>
            </div>
            <div class="am-form-group">
                <label for="sex" class="am-u-sm-2 am-form-label">性别</label>
                <div class="am-u-sm-10" id="sex">
                    <label>
                        <input type="radio" name="sex" value="男" checked>
                    </label> 男
                    <label>
                        <input type="radio" name="sex" value="女">
                    </label> 女
                </div>
            </div>
            <div class="am-form-group">
                <label for="role" class="am-u-sm-2 am-form-label">角色</label>
                <div class="am-u-sm-10" id="role">
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="role" value="超级管理员"> 超级管理员
                    </label>
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="role" value="系统管理员"> 系统管理员
                    </label>
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="role" value="测试账号"> 测试账号
                    </label>
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="role" value="游客"> 游客
                    </label>
                </div>
            </div>
            <div class="am-form-group">
                <label for="status" class="am-u-sm-2 am-form-label">用户状态</label>
                <div class="am-u-sm-10">
                    <select id="status" name="status" class="am-u-sm-10">
                        <option value="启用">启用</option>
                        <option value="禁用">禁用</option>
                        <option value="锁定">锁定</option>
                        <span class="am-form-caret"></span>
                    </select>
                </div>
            </div>
            <div class="am-form-group">
                <div class="am-u-sm-10 am-u-sm-offset-2">
                    <button type="submit" class="am-btn am-btn-success">提交</button>
                    &nbsp;&nbsp;
                    <input type="reset" value="重置" class="am-btn am-btn-warning am-btn-sm"/>
                </div>
            </div>
        </form>

        <hr>
        <p>© 2019 Web Book Store Management platform</p>
    </div>
</div>

</body>

</html>
